package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.example.domain.entity.Admin;
import com.example.domain.entity.Params;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;


import java.util.List;

@Repository
public interface AdminMapper extends BaseMapper<Admin> {

    List<Admin> findBySearch(@Param("params") Params params);

    @Select("select * from admin where username = #{username} limit 1")
    Admin findByUserName(@Param("username") String username);

    @Select("select * from admin where username = #{username} and password = #{password} limit 1")
    Admin findByNameAndPassword(@Param("username") String username, @Param("password") String password);
    
    
}
